package com.rongxun.base;

import android.content.Context;

import java.lang.ref.WeakReference;

/**
 * Created by nelon on 17-8-21.
 */

public abstract class BaseModel implements IBase.IModel {
    private WeakReference<Context> mWeakReference;

    public BaseModel(Context pContext) {
        mWeakReference = new WeakReference<Context>(pContext);
    }

    public Context getContext() {
        return mWeakReference.get();
    }

    @Override
    public void release() {
        innerRelease();
        mWeakReference.clear();
    }

    protected abstract void innerRelease();
}
